package com.zhuojy.equity.mall.admin.web.config;

import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @author chen
 * @version 1.0
 * @description: TODO
 * @date 2023/10/17 10:48
 */
@Configuration
@EnableSwagger2
@EnableKnife4j
public class SwaggerConfig {
    @Bean(value = "domeAPI")
    public Docket defaultApi2(){
        Docket docket = new Docket(DocumentationType.OAS_30)
                .apiInfo(new ApiInfoBuilder()
                    .title("OA数字化管理平台")
                    .description("# 这里记录服务端所有的接口的入参,出参等等信息")
                    .termsOfServiceUrl("http://yaomaoyan.com")
                    .contact(new Contact("Mrchen","http://127.0.0.1","2785281040@qq.com"))
                    .version("3.0")
                    .build())
                //分组名称
                .groupName(Docket.DEFAULT_GROUP_NAME)
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.zhuojy.equity.mall.admin.web.controller"))
                .paths(PathSelectors.any())
                .build();
        return docket;
    }
}
